package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobil    string `gorm:"type:varchar(11)"`
	Password string `gorm:"type:varchar(32)"`
}

func (u *User) FindUser(db *gorm.DB, mobil string) error {
	return db.Debug().Where("mobil=?", mobil).Find(u).Error
}

func (u *User) CreatUser(db *gorm.DB) error {
	return db.Debug().Create(u).Error
}
